package com.example.ddz;

import java.util.Vector;

public class Keeper {
	  public static int max;
	  public static int maxZha;
	  public static Vector<Card> playerDOutCards;
	  public static Vector<Card> playerMOutCards;
	  public static Vector<Card> playerUOutCards;
	  public static Vector<Card> remainCards = null;

	  static
	  {
	    playerUOutCards = new Vector();
	    playerDOutCards = new Vector();
	    playerMOutCards = new Vector();
	    max = 0;
	    maxZha = 0;
	  }

	  private static void clearAllOutCards()
	  {
	    playerUOutCards.removeAllElements();
	    playerDOutCards.removeAllElements();
	    playerMOutCards.removeAllElements();
	  }

	  public static int getMax()
	  {
	    return max;
	  }

	  public static int getMaxZha()
	  {
	    return maxZha;
	  }

	  public static void init(Vector<Card> paramVector)
	  {
	    remainCards = AI.sortByBigOrSmall(paramVector);
	    clearAllOutCards();
	    max = 17;
	    maxZha = 17;
	  }

	  public static void remove(Player paramPlayer, Vector<Card> paramVector)
	  {
	    if (paramVector == null)
	      return;
	    boolean bool1 = AI.deleteCards(remainCards, paramVector);
	    int i = paramPlayer.getPlayerType();
	    if (i == 1)
	    {
	      j = paramVector.size();
	      k = 0;
	      while (true)
	      {
	        if (k >= j)
	        {
	          playerMOutCards = AI.sortByBigOrSmall(playerMOutCards);
	          remainCards = AI.sortByBigOrSmall(remainCards);
	          max = ((Card)remainCards.elementAt(0)).num;
	          remainCards = AI.sortByFaceAndSuit(remainCards);
	          maxZha = ((Card)remainCards.elementAt(0)).num;
	          break;
	        }
	        Vector localVector1 = playerMOutCards;
	        int m = ((Card)paramVector.elementAt(k)).index;
	        int n = ((Card)paramVector.elementAt(k)).suit;
	        Card localCard1 = new Card(m, n);
	        boolean bool2 = localVector1.add(localCard1);
	        k += 1;
	      }
	    }
	    if (i == 3)
	    {
	      j = paramVector.size();
	      k = 0;
	      while (true)
	      {
	        if (k >= j)
	        {
	          playerDOutCards = AI.sortByBigOrSmall(playerDOutCards);
	          break;
	        }
	        Vector localVector2 = playerDOutCards;
	        int i1 = ((Card)paramVector.elementAt(k)).index;
	        int i2 = ((Card)paramVector.elementAt(k)).suit;
	        Card localCard2 = new Card(i1, i2);
	        boolean bool3 = localVector2.add(localCard2);
	        k += 1;
	      }
	    }
	    int j = paramVector.size();
	    int k = 0;
	    while (true)
	    {
	      if (k >= j)
	      {
	        playerUOutCards = AI.sortByBigOrSmall(playerUOutCards);
	        break;
	      }
	      Vector localVector3 = playerUOutCards;
	      int i3 = ((Card)paramVector.elementAt(k)).index;
	      int i4 = ((Card)paramVector.elementAt(k)).suit;
	      Card localCard3 = new Card(i3, i4);
	      boolean bool4 = localVector3.add(localCard3);
	      k += 1;
	    }
	  }
}
